package com.king.util;

import com.king.constant.ResponseStatus;
import com.king.pojo.vo.AjaxResult;
import org.springframework.http.HttpStatus;

/**
 * @author liukai
 */
public class AjaxResultUtil {

    public static AjaxResult success() {
        return new AjaxResult(ResponseStatus.SUCCESS);
    }

    public static AjaxResult success(Object data) {
        return new AjaxResult(ResponseStatus.SUCCESS, data);
    }


    public static AjaxResult error(HttpStatus httpStatus, String message, Object data) {
        return new AjaxResult(ResponseStatus.SERVER_ERROR);
    }

    public static AjaxResult error(HttpStatus httpStatus, String message) {
        return new AjaxResult(ResponseStatus.SERVER_ERROR);
    }


}
